package com.example.demo.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 预约类
 */
public class Reservation {
    private int id;
    private int book_id;
    private int reader_id;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date reservation_date;//预约时间
    private int reservatiion_state;//预约状态 1 - 不超时、2 - 超时、3-已被借走

    private User user;
    private Books books;

    public Reservation() {
    }

    public Reservation(int book_id, int reader_id, Date reservation_date,int reservatiion_state) {
        this.book_id = book_id;
        this.reader_id = reader_id;
        this.reservation_date = reservation_date;
        this.reservatiion_state = reservatiion_state;
    }

    @Override
    public String toString() {
        return "Reservation{" +
                "id=" + id +
                ", book_id=" + book_id +
                ", reader_id=" + reader_id +
                ", reservation_date=" + reservation_date +
                ", reservatiion_state=" + reservatiion_state +
                ", user=" + user +
                ", books=" + books +
                '}';
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Books getBooks() {
        return books;
    }

    public void setBooks(Books books) {
        this.books = books;
    }

    public int getReservatiion_state() {
        return reservatiion_state;
    }

    public void setReservatiion_state(int reservatiion_state) {
        this.reservatiion_state = reservatiion_state;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getBook_id() {
        return book_id;
    }

    public void setBook_id(int book_id) {
        this.book_id = book_id;
    }

    public int getReader_id() {
        return reader_id;
    }

    public void setReader_id(int reader_id) {
        this.reader_id = reader_id;
    }

    public Date getReservation_date() {
        return reservation_date;
    }

    public void setReservation_date(Date reservation_date) {
        this.reservation_date = reservation_date;
    }
}
